<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>上门取车-去保养</title>
    <meta name="keywords" content="去保养,汽车保养,汽车配件,汽车维修,养车,4S店品质,氦修驿站" />
    <meta name="description" content="上门取车保养、保养在线观看、咖啡馆里做保养、夜间保养" />
    <link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/css/base.css">
    <link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/mobile/css/master.css">
    <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?11ad56ca0738ac14d150a362fca3e058";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>

    <style>
        header{position:relative; z-index:10}
        #allmap{height:100%;display:none;top:-50px; position:fixed;width:100%;z-index:0}

        #search{text-align:center;color:#3EB7E9;padding-top:80px; position:relative;z-index:2;height:100%;background:#fff;box-sizing: border-box;}
        #search h2{font-size:24px;}
        #search h3{font-size:14px;margin-top:10px;color:#888;}
        #search h4{font-size:16px;margin-top:20px;color:#888;font-weight:500;}
        
        #address{ position:fixed;top:60px;background:#fff;border:1px solid #ddd;width:94%;box-sizing: border-box;z-index:1;margin-left:3%;border-radius:3px;line-height:16px;padding:3px 0;}
        #address i{float:left;font-size:20px;margin:10px 0 0 5px;}
        #address h5{text-align:center;color:#f60;font-size:11px;font-weight:500;margin-bottom:2px;}
        #address p{color:#888;text-align:center;margin-left:40px;font-size:13px;}
        
        /*顶部当前状态*/
        #status{ position:fixed;top:60px;background:#fff;border:1px solid #ddd;width:94%;box-sizing: border-box;z-index:1;margin-left:3%;border-radius:3px;line-height:16px;padding:10px;}
        #status a{color:#369;}
        #status span{float:right;color:#f60;}

        #inputAddress{}

        #userInfo{ position:fixed;top:0px;right:0;left:0;bottom:0;width:90%;z-index:10;margin:auto;height:260px;box-shadow:0 0 6px #888;border-radius:5px;overflow:hidden;background:#fff;display: none;}
        #userInfo .close{ position:absolute;top:0px;right:0px;background:#fff;border:0px solid #ddd;width:24px;height:24px;text-align:center;line-height:24px;font-size:16px;border-radius:0 5px 0 0;z-index:10;}
        #userInfo input[type='text']{border:1px solid #ddd;margin:5px 0;padding:8px 5px;width:90%;}
        #userInfo button{border:0px;background:#f60;color:#fff;text-align:center;width:45%;padding:10px 0;border-radius:5px;margin-left:8px;}
        #userInfo .btnClose{background:#bbb;}
        #userInfo .serverList,#userInfo .info{padding:10px;background: #fff;margin-bottom:20px;}
        #userInfo .serverList ul{}
        #userInfo .serverList li{float:left;width:25%;text-align:center;margin-bottom:10px;}
        #userInfo .serverList li i{display:block;font-size:52px;background:#EEEEEE;color:#CCCCCC;width:46px;height:46px;line-height:46px;text-align:center;margin:auto;border-radius:23px;}
        #userInfo .serverList .current i{background:#F5B445;color:#fff;}
        #userInfo h4{height:30px;line-height:30px;text-align:center;border-bottom:1px solid #ddd;margin-bottom:10px;font-size:16px;font-weight:500;}

        #sjInfo{ position:fixed;top:0px;right:0;left:0;bottom:0;width:90%;height:380px;z-index:10;background:#fff;margin:auto;height:250px;box-shadow:0 0 6px #888;border-radius:5px;overflow:hidden;display:none;}
        #sjInfo .close{ position:absolute;top:0px;right:0px;background:#fff;border:0px solid #ddd;width:24px;height:24px;text-align:center;line-height:24px;font-size:16px;border-radius:0 5px 0 0;z-index:10;}
        #sjInfo .infoMain{text-align:center;}
        #sjInfo .infoMain img{width:60px;height:60px;border-radius:30px;margin:20px 0 10px 0;}
        #sjInfo .infoMain ul{border-top:1px solid #ddd;margin:10px 15px;}
        #sjInfo .infoMain li{float:left;width:33%;padding:10px 0;text-align:center;}
        #sjInfo .infoMain li em{display:block;font-size:14px;}
        #sjInfo .infoMain li:nth-child(2){border-right:1px solid #ddd;border-left:1px solid #ddd;}
        #sjInfo .infoMain button{background:#f60;color:#fff;width:80%;line-height:40px;border:0px;margin:10px 0;border-radius:20px;font-size:16px;}

        #sjInfo .commentList{padding:10px;background:#fff;height:200px;overflow-y:auto;overflow-x:hidden;}
        #sjInfo .commentList li{border-bottom:1px solid #e0e0e0;padding:10px;}
        #sjInfo .commentList .time{color:#999;}
        #sjInfo .commentList span{float:right;width:60px;height:12px;}
        #sjInfo .commentList .star1{background:url("/Public/mobile/images/stars_1.png") no-repeat;background-size:100% 100%;}
        #sjInfo .commentList .star2{background:url("/Public/mobile/images/stars_2.png") no-repeat;background-size:100% 100%;}
        #sjInfo .commentList .star3{background:url("/Public/mobile/images/stars_3.png") no-repeat;background-size:100% 100%;}
        #sjInfo .commentList .star4{background:url("/Public/mobile/images/stars_4.png") no-repeat;background-size:100% 100%;}
        #sjInfo .commentList .star5{background:url("/Public/mobile/images/stars_5.png") no-repeat;background-size:100% 100%;}

        #btnCreateOrder{border:0px;background:url("/Public/mobile/images/centerIcon1.png") no-repeat;background-size:100% 100%;width:40px; height:40px; position:fixed;top:-35px;right:0px;left:0px;bottom:0px;margin:auto;z-index:9;display:none;}
        #btnCreateOrder em{color:#fff;background:url("/Public/mobile/images/centerIcon2.png") no-repeat;background-size:100% 100%;position: relative; top: -32px;width:72px;height:30px;left:-17px;display:block;line-height: 28px;}

        #orderInfo{width:100%;height:100%; position:fixed;left:0px;top:0px;z-index:11;-webkit-transition: all 0.2s ease-out;}
        #orderInfo a{display:block;width:100%;height:100%;}
        #orderInfo.close{left:100%;}

    </style>
    </head>
    <body>
        <header class="tcenter fs14">
            <a href="{:C('WEB_URL')}mobile/" class="iconfont fright">&#xe60f;</a>
            <a href="javascript:window.history.go(-1)" class="iconfont fleft">&#xe612;</a>
            上门取车
        </header>

        <div id="allmap"></div>
        <div id="search">
            <div id="page" class="container">
                <hgroup class="tip page_loading">
                    <h2>欢迎您使用上门取车服务</h2>
                    <h3 class="">本服务由爱代驾提供</h3>
                    <h4>正在获取您的位置</h4>
                </hgroup>
                <img src="/Public/mobile/images/loding.gif" style="display:block;margin: 20px auto;">
            </div>
        </div>
        

        
        
        <empty name="order">
            <button id="btnCreateOrder"><em>立即取车</em></button>
            <div id="address">
                <i>&#xe62e;</i>
                <h5>取车地点</h5>
                <p class="address">正在获取地址</p>
            </div>
        <else />
            <button id="btnCreateOrder"><em>正在服务中</em></button>
            <div id="status">
                <a href="javascript:enterData.showInfo()">
                    <span>查看</span>
                    您当前有服务正在进行中...
                </a>
            </div>
        </empty>
        
        <!-- 输入地址 start-->
        <div id="inputAddress">
            
        </div>
        <!-- 输入地址 end-->
        
        <!-- 司机详情 start-->
        <div id="sjInfo">
            <div class="infoMain">
                
            </div>
            <ul class="commentList"></ul>
            <button class="close" onclick="$('#sjInfo').hide()"><i>&#xe609;</i></button>
        </div>
        <!-- 司机详情 end-->
        
        <!-- 个人资料 start-->
        <div id="userInfo">
            <div class="serverList">
                <h4>选择服务项目</h4>
                <ul class="clearfix" id="J_serverList">
                    <li class="current" data-type="1"><i>&#xe62f;</i>小保养</li>
                    <li data-type="2"><i>&#xe630;</i>大保养</li>
                    <li data-type="3"><i>&#xe631;</i>刹车油</li>
                    <li data-type="4"><i>&#xe632;</i>防冻液</li>
                    <li data-type="5"><i>&#xe632;</i>空调检测</li>
                </ul>
                <div>
                    <button class="btnClose" onclick="$('#userInfo').hide()">取消</button>
                    <button class="submit" onclick="enterData.toStep2();">下一步</button>
                </div>
            </div>
            <div class="info hide" id="J_userInfo">
                <h4>个人信息</h4>
                <p><input type="text" name="realname" placeholder="您的姓名" value="{$_SESSION['user']['realname']}" /></p>
                <p><input type="text" name="phone" placeholder="您的手机号"   value="{$_SESSION['user']['username']}" /></p>
                <p><input type="hidden" name="address" /></p>
                
                <p><input type="hidden" name="addressBack" placeholder="输入您的还车地址"  />&nbsp;</p>
                <p><input type="checkbox" checked="true" id="J_backType" />&nbsp;取车地址与还车地址相同</p>
                <div class="mt10">
                    <button class="btnClose" onclick="enterData.toStep1()">上一步</button>
                    <button class="submit" onclick="enterData.submit();">立即取车</button>
                </div>
            </div>
            
        </div>
        <!-- 个人资料 end-->
        <notempty name="order">
            <iframe src="/adj/djInfo.html?id={$order['order_id']}" frameborder="0" id="orderInfo"></iframe>
        </notempty>
    </body>

    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=VbnQGVjnYpXMHBu8jHgv6vHs"></script>
    <!--<script type="text/javascript" src="http://api.map.baidu.com/api?type=quick&ak=VbnQGVjnYpXMHBu8jHgv6vHs&v=1.0"></script>-->
    <script type="text/javascript" src="/Public/js/zepto1.1.4.min.js"></script>

    <script type="text/javascript">
        //选择服务弹窗
        var enterData={
            serverList:$("#J_serverList"),
            info:$("#userInfo > .info"),
            orderId:"{$order['order_id']}", //当前订单ID

            init:function(){
                //选择服务
                var _t=this;

                if(_t.orderId!=""){
                    _t.getOrderStatus();
                }

                $("#J_serverList").tap(function(e){
                    if(e.target.tagName==='I'){
                        var element=$(e.target).parent();
                    }else if(e.target.tagName==='LI'){
                        var element=$(e.target);
                    }

                    var serverId=element.attr("data-type");
                    if(serverId==1){
                        _t.serverList.find("li").eq(1).removeClass("current");
                    }else if(serverId==2){
                        _t.serverList.find("li").eq(0).removeClass("current");
                    }

                    if(element.hasClass("current")){
                        element.removeClass("current");
                    }else{
                        element.addClass("current");
                    }
                    
                })
                $("#J_backType").tap(function(){
                    if($(this).prop("checked")){
                        $("input[name='addressBack']").attr("type","hidden");
                    }else{
                        $("input[name='addressBack']").attr("type","text");
                    }
                })
            },
            showDialog:function(){
                $("#userInfo").show();
            },

            toStep1:function(){
                $("#userInfo > .serverList").show();
                $("#userInfo > .info").hide();
            },

            toStep2:function(){
                var _t=this,
                    select=_t.serverList.find(".current"),
                    len=select.length;

                if(len==0){
                    alert("请选择保养项目");
                    return ;
                }
                $("#userInfo > .serverList").hide();
                $("#userInfo > .info").show();
            },
            submit:function(){
                var _t=this,
                    select=_t.serverList.find(".current"),
                    data={},
                    len=select.length,
                    i=0;

                if(len==0){
                    alert("请选择保养项目");
                    _t.toStep1();
                    return false;
                }else if(len==1){
                    data['serverType']=select.attr("data-type");
                    data['serverList']=data['serverType'];
                }else if(len>1){
                    data['serverList']="";
                    data['serverType']=999; //选择服务多于1项则为综合保养
                    for(;i<len;i++){
                        data['serverList']+=data['serverList']==""?select.eq(i).attr("data-type"):","+select.eq(i).attr("data-type");   //被选择的服务项目
                    }

                }
                map.createOrderNow(data);
            },

            closeOrderInfo:function(){
                //清除详情内容
                $("#orderInfo").addClass("close");
            },
            showInfo:function(){
                //显示并重新加载详情内容
                $("#orderInfo").removeClass("close");
            },
            refresh:function(){
                window.location.href="/adj/";
            },

            //持续获取订单最新状态,如有改变，刷新详情页
            orderStatus:"{$orderStatus}",
            getOrderStatus:function(){
                var _t=this,
                    data={};
                data['orderId']=_t.orderId;
                setTimeout(function(){
                    $.ajax({
                        url:"/adjBate/getOrderStatus",
                        data:data,
                        type:"post",
                        dataType:"json",
                        success:function(res){
                            if(res.data!=_t.orderStatus){
                                var url="/adj/djInfo.html?id="+_t.orderId+"&t="+Math.random(1);
                                $("#orderInfo").attr("src",url);
                                _t.orderStatus=res.data;
                            }
                            _t.getOrderStatus();
                        }
                    })
                },5000);
            }
            //刷新

        }
        enterData.init();
        var map={
            map:null,
            listSJ:{},  //司机列表
            lng:120.264614, //默认经度
            lat:30.176497,  //默认纬度
            init:function(){
                var _t=this;
                if(navigator.geolocation){

                    window.localStorage.setItem("lng",null);
                    if(window.localStorage.getItem("lng")!=null){
                        _t.initMap(window.localStorage.getItem("lng"),window.localStorage.getItem("lat"));
                    }
                    //浏览器支持geolocation
                    var geolocation = new BMap.Geolocation(); 
                        geolocation.getCurrentPosition(function (r) {

                        if (this.getStatus() == BMAP_STATUS_SUCCESS ) {
                            window.localStorage.setItem("lng",r.point.lng);
                            window.localStorage.setItem("lat",r.point.lat);

                            if(window.localStorage.getItem("lng")!=null){
                                var point = new BMap.Point(r.point.lng,r.point.lat);
                                //_t.map.centerAndZoom(point,15);
                            }else{
                                _t.initMap(r.point.lng,r.point.lat);
                            }
                        }else{
                            console.log("无法定位");
                        }
                    })

                }else{
                    _t.errorPoint({code:5});
                }

                $("#btnCreateOrder").tap(function(){
                    if($(this).find("em").html()=="立即取车"){
                        enterData.showDialog();
                    }else{
                        enterData.showInfo();
                    }
                })

            },
            //无法定位
            errorPoint:function (error){
                var errorArr=["","位置服务被拒绝","暂时获取不到位置信息","获取信息超时","未知错误","您的设备不支获取定位"];
                //alert(errorArr[error.code]);
                //alert("无法获取您的位置");

                //改换为自主输入地址
                $("#address").show();
                $("#search").hide();
            },

            initMap:function (lng,lat){
                
                lng=this.lng;
                lat=this.lat;


                $("#search").hide();
                $("#allmap").show();
                $("#address").show();
                var _t=this;
                var point=new BMap.Point(lng,lat);

                //初始化地图 
                _t.map = new BMap.Map("allmap");
                _t.map.centerAndZoom(point, 15); //设置中心点

                var ZOOM = new BMap.NavigationControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT, type: BMAP_NAVIGATION_CONTROL_ZOOM});
                _t.map.addControl(ZOOM);    //添加地图缩放控件

                var myIcon = new BMap.Icon("/Public/mobile/images/mapLocalIcon.png",new BMap.Size(22,22)); 
                var myIcon2 = new BMap.Icon("/Public/mobile/images/mapLocalIcon.png",new BMap.Size(22,22));

                 //自定义标记ICON   
                var marker1 = new BMap.Marker(point,{icon: myIcon});  //创建标注
                var marker2 = new BMap.Marker(point,{icon: myIcon});  //创建标注
                _t.map.addOverlay(marker1); // 将标注添加到地图中
                _t.map.addOverlay(marker2); // 将标注添加到地图中

                _t.map.addEventListener("dragend", function(){
                    var center = _t.map.getCenter();
                    $("#address").children("p").html("正在获取地址");
                    _t.tipMsgStatus=false;
                    _t.pointToAddress(new BMap.Point(center.lng,center.lat));
                });
                
                $("#btnCreateOrder").show();

                _t.getShiJi(lng,lat);   //获取司机列表
                _t.pointToAddress(point);   //经纬度转地址
            },

            //立即取车，自动匹配最近司机并下单
            tipMsgStatus:false, //创建订单时判断当前是否已进行地址提示
            createOrderStatus:false,    //是否已创建订单
            createOrderNow:function(data){
                if(this.createOrderStatus){
                    return false;
                }
                this.createOrderStatus=true;
                var address=$("#address > .address").html(),
                    _t=this;

                if(address=="正在获取地址"){
                    if(!_t.tipMsgStatus){
                        alert("正在获取您的位置，请稍后");
                    }
                    _t.tipMsgStatus=true;
                    setTimeout(function(){
                        _t.createOrderNow(data);
                    },1000);
                    return false;
                }else{
                    $("#J_userInfo").find("input[name='address']").val(address)
                }

                data['name']=$("#J_userInfo").find("input[name='realname']").val();
                data['phone']=$("#J_userInfo").find("input[name='phone']").val();
                data['address']=address;
                data['wx_id']=441;

                var backType=$("#J_backType").prop("checked"),
                    addressBack=$("#J_userInfo").find("input[name='addressBack']").val();
                
                if(backType){
                    data['addressBack']=address;
                }else if(!backType&&addressBack==""){
                    alert("请输入还车地址！");
                }else{
                    data['addressBack']=addressBack;
                }

                if(data['name']==""){
                    alert("请输入您的姓名");
                    return false;
                }else if(data['phone']==""){
                    alert("请输入您的手机号");
                    return false;
                }

                console.log("显示LOADING界面");

                data['lat']=this.lat;
                data['lng']=this.lng;

                $.ajax({
                    url:"/adjBate/createOrderNow/",
                    data:data,
                    type:"post",
                    dataType:"json",
                    success:function(res){
                        if(res.status==1){
                            _t.getOrderInfo(res.data);    //获取爱代驾订单最新数据
                        }else{
                            alert(res.info);
                        }
                    }
                })
            },


            //获取订单详情
            getOrderInfo:function(orderId){

                var _t=this;
                $.ajax({
                    url:"/adjBate/getOrderInfo/",
                    data:{"orderId":orderId},
                    type:"post",
                    dataType:"json",
                    success:function(res){
                        console.log(res);
                        if(res.status==1){
                            window.getOrderInfoTimeout=setTimeout(function(){
                                _t.getOrderInfo(orderId);
                            },5000);
                            _t.printDaiJiaInfo(res.data[0]);
                        }else{
                            alert(res.info);
                        }
                    }
                })
            },


            //输出代驾状态
            printDaiJiaInfo:function(data){
                
                console.log(data);
            },

            //通过地址获取坐标
            addressToPoint:function(){
                var _t=this;
                var address=$("#J_addressVal").val();
                if(address==""){
                    alert("请输入地址！");
                    return false;
                }

                //获取地址相应经纬度
                $.ajax({
                    url:"/adjBate/geocoder/",
                    data:{"address":address},
                    type:"post",
                    dataType:"json",
                    success:function(res){
                        if(res.status==1){
                            _t.initMap(res.data.location.lat,res.data.location.lng);
                        }else{
                            alert(res.info);
                        }
                    }
                })
            },

            //通过坐标获取地址
            geoc:new BMap.Geocoder(),
            pointToAddress:function(point){
                this.geoc.getLocation(point, function(rs){
                    var addComp = rs.addressComponents,
                        address=addComp.city + " " + addComp.district + " " + addComp.street + " " + addComp.streetNumber;
                        //addComp.province 省份
                    $("#address").children("p").html(address);
                });
            },

            //获取司机列表
            getShiJi:function(lng,lat){
                var _t=this;
                $.ajax({
                    url:"/adjBate/getSJ/",
                    data:{"lat":lat,"lng":lng},
                    type:"post",
                    dataType:"json",
                    success:function(res){
                        if(res.status==1){
                            _t.printShiJi(res.data);
                        }else{
                            alert(res.info);
                        }
                    }
                })
            },

            //输出司机列表
            printShiJi:function(data){
                console.log(data);
                if(data==null){
                    alert("附近司机都在忙哦！");
                    return false;
                }
                var _t=this,
                    i=0,
                    len=data.length;

                if(len==0){
                    return false;
                }

                // 复杂的自定义覆盖物
                function SquareOverlay(point,text,id,icon){
                    this._point = point;
                    this._text = text;        //司机姓名
                    this._id=id;  //司机ID
                    this._icon=icon;
                }
                
                SquareOverlay.prototype = new BMap.Overlay();
                SquareOverlay.prototype.initialize = function(map){
                    this._map = map;
                    var div = this._div = document.createElement("div");
                    var id = this._id;
                    div.style.position = "absolute";
                    div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
                    div.style.background = "url("+this._icon+") no-repeat";
                    div.style.backgroundSize = "100% 100%";
                    div.style.color = "white";
                    div.style.height = "44px";
                    div.style.width = "60px";
                    div.style.textAlign = "center";
                    div.style.whiteSpace = "nowrap";

                    div.appendChild(document.createTextNode(this._text));   //写入姓名

                    var arrow = this._arrow = document.createElement("div");
                    arrow.style.position = "absolute";
                    arrow.style.top = "44px";
                    arrow.style.left = "60px";
                    arrow.style.overflow = "hidden";
                    div.appendChild(arrow);

                    div.onclick=function(){
                        _t.printShiJiInfo(id);
                    }

                    _t.map.getPanes().markerPane.appendChild(div);
                    return div;
                }


                SquareOverlay.prototype.draw = function(){
                    // 根据地理坐标转换为像素坐标，并设置给容器
                    var pixel = this._map.pointToOverlayPixel(this._point);
                    this._div.style.left = pixel.x - parseInt(this._arrow.style.left)/2 + "px";
                    this._div.style.top  = pixel.y - parseInt(this._arrow.style.top)/2 + "px";
                }

                for(;i<len;i++){
                    if(data[i]['state']=="空闲中"){
                        var point=new BMap.Point(data[i]['lng'],data[i]['lat']);
                        var myCompOverlay = new SquareOverlay(point, data[i]['name'],data[i]['ucode'],getLevelIcon(data[i]['cishu']));
                        _t.listSJ[data[i]['ucode']]=data[i];
                        _t.map.addOverlay(myCompOverlay);
                    }
                }


                //获取司机相关星级ICON
                function getLevelIcon(num){
                    var file="/Public/mobile/images/sjMapIcon-*.png";
                    if(num<30){
                        return file.replace("*",1);
                    }else if(num<60){
                        return file.replace("*",2);
                    }else if(num<90){
                        return file.replace("*",3);
                    }else if(num<120){
                        return file.replace("*",4);
                    }else if(num<150){
                        return file.replace("*",5);
                    }else if(num<300){
                        return file.replace("*",6);
                    }else if(num<450){
                        return file.replace("*",7);
                    }else if(num<600){
                        return file.replace("*",8);
                    }else if(num<750){
                        return file.replace("*",9);
                    }else if(num<900){
                        return file.replace("*",10);
                    }
                }

            },

            //输出司机详情
            printShiJiInfo:function(id){
                var _t=this,
                    img=_t.listSJ[id]['pic'],
                    name=_t.listSJ[id]['name'],
                    cishu=_t.listSJ[id]['cishu'],
                    jialin=_t.listSJ[id]['jialin'],
                    goodrate=_t.listSJ[id]['goodrate'];

                    html='<img src="'+img+'" />'+
                        '<p class="name">'+name+'</p>'+
                        '<ul>'+
                            '<li class="goodrate"><em>'+goodrate+'%</em><span>满意度</span></li>'+
                            '<li class="cishu"><em>'+cishu+'次</em><span>服务</span></li>'+
                            '<li class="jialin"><em>'+jialin+'年</em><span>驾龄</span></li>'+
                        '</ul>'+
                        '<button>立即取车</button>';

                $("#sjInfo").show().children(".infoMain").html(html);

                //_t.getComment(id);

            },
            //获取司机评价
            getComment:function(id){
                $.ajax({
                    url:"/adjBate/getSJComment/",
                    data:{"ucode":id},
                    type:"post",
                    dataType:"json",
                    success:function(res){
                        if(res.status==1){
                            var i=0,
                                len=res.data.length,
                                html="";

                            for(;i<len;i++){
                                html+='<li>'+
                                    '<span class="star'+res.data[i]['Evaluate']+'"></span>'+
                                    '<p class="time">'+res.data[i]['Create_time'].substring(0,10)+'</p>'+
                                    '<p class="txt">'+res.data[i]['Comment']+'</p>'+
                                '</li>';
                            }
                             $("#sjInfo > ul").html(html)
                        }else{
                        }
                    }
                })

            }
        }
        map.init();

    </script>
</html>